import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import { getToken } from './common/utlis/auth'

Vue.config.productionTip = false

router.beforeEach((to, from, next) => {
  debugger
  const token = getToken()
  if (!token) {
    // 跳转到登录页面
    router.push({name: "login"})
    //next('/login')
  }else {
    next()
  }
})

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
